<!DOCTYPE html>
<html>
	<head>
	    <meta charset="UTF-8">
	    <title>业主信息</title>
	    <meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
	    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	    <link rel="stylesheet" href="../../css/font.css">
	    <link rel="stylesheet" href="../../css/xadmin.css">
	    <script type="text/javascript" src="../../js/jquery-3.2.1.js"></script>
	    <script type="text/javascript" src="../../lib/layui/layui.js" charset="utf-8"></script>
	    <script type="text/javascript" src="../../js/xadmin.js"></script>
  	</head>
	
	<body>
		<div class="x-body" id="show" data-id="">
			
			<div style="height:20px;">
			</div>
			
			<div class="layui-form-item">
				业主账号:<span id="userName" class="info"></span>
			</div>
			
			<div style="height:20px;">
			</div>
			
			<div class="layui-form-item">
				业主姓名:<span id="presonName" class="info"></span>
			</div>
			
			<div style="height:20px;">
			</div>
			
			<div class="layui-form-item">
				年龄:<span id="personAge" class="info"></span>
			</div>
			
			<div style="height:20px;">
			</div>
			
			<div class="layui-form-item">
				性别:<span id="personSex" class="info"></span>
			</div>
			
			<div style="height:20px;">
			</div>
			
			<div class="layui-form-item">
				电话号码:<span id="telephone" class="info"></span>
			</div>
			
			<div style="height:20px;">
			</div>
			
		</div>
	</body>
	
	
	<script>
	
	$(function(){
		
		//从url中截取传入的参数
        //这种方法获得的所有参数是一个json的值
        function GetRequest() {
      	   var url = location.search; //获取url中"?"符后的字串
      	   var theRequest = new Object();
      	   if (url.indexOf("?") != -1) {
      	      var str = url.substr(1);
      	      strs = str.split("&");
      	      for(var i = 0; i < strs.length; i ++) {
      	         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
      	      }
      	   }
      	   return theRequest;
        }
        //从json中获取对应的参数值
        var id =GetRequest().id;
        //在主块中绑定一个这条信息的ID
        $("#show").attr("data-id",id);
        
        
        
        $.ajax({
        	type:"post",
            url:"../../Information/getUserInfoByUserID",
            async:true,
            data:{"id":id},//自己改id
            success:function(result){
            	
            	$(".info").css("color","blue");
            	
            	console.log(result.user);
            	$("#userName").text(result.user.userName);
            	$("#presonName").text(result.user.presonName);
            	$("#personAge").text(result.user.personAge);
            	$("#personSex").text(result.user.personSex);
            	$("#telephone").text(result.user.telephone);
            },
            error:function(){
            	console.log("debug");
            }
        });
        
        
		
	});
	
	</script>
	
	
</html>
